-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add API #3
base: develop
Are you sure you want to change the base?
Add API #3
Conversation
cmd/staking/main.go
Outdated
@@ -48,5 +49,8 @@ func cmdMain(ctx *cli.Context) error { | |||
kyberSc.GetStake(uint64(1), "mike") | |||
log.Println("staking done") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove above code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From line 43 to 50 or just line 50 only?
defer self.mu.Unlock() | ||
|
||
e.GET("/", h.GetIndex) | ||
e.GET("/swagger/*", echoSwagger.WrapHandler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this api?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swagger is used to serve API doc, so people can easily test APIs
api/server.go
Outdated
e.POST("/delegate", h.Delegate) | ||
e.POST("/vote", h.Vote) | ||
|
||
e.GET("/stake", h.GetStake) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please name api like smartcontract function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
api/server.go
Outdated
e.GET("/delegateStake", h.GetDelegateStake) | ||
e.GET("/representative", h.GetRepresentative) | ||
e.GET("/reward", h.GetReward) | ||
e.GET("/poolReward", h.GetPoolReward) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -0,0 +1,355 @@ | |||
definitions: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is generated by Swagger, we can ignore it
No description provided.